<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
		
	// 1
	//  [456,34,34,34,3,4] 封装一个函数，实现返回最大值 
	// 2 
	// [345,34,23,3,32,2,25,56] 封装一个函数，实现返回一个新数组，把原来是奇数的乘以2

	

	arr = [3,56,333,34,78,5];

	function getMax(inArr) {
		br();
		max = arr[0];
		for(var i in inArr){
			if(inArr[i]>max){
				max = inArr[i];
			}
		}
		return max;
	}

	// res = getMax(arr);

	// document.write(res);

	arr = [5,6,7,3,8,5,9];

	function changeOu(inArr) {
		for(var i in inArr){
			if(inArr[i]%2==1){
				inArr[i] = inArr[i]*2;
			}
		}
		return inArr;
	}

	// res = changeOu(arr);

	// document.write(res);

	function br() {
		document.write("<br>");
	}

	arr = [4,6,8,3,7];

	function turn(inArr) {
		cn =0;

		for (var i in inArr) {
			cn++;
		}

		newArr = [];
		
		for (var i in inArr) {
			
			newArr[cn-1-i] = inArr[i]; 
		}

		return newArr;

	}

	res = turn(arr);

	document.write(res);


	</script>
</head>
<body>
	
</body>
</html>